{% include "header.html" %}
<div id="wrapper">
	<div id="simple-content-wrapper">
		<div id="content">
			<p><a href="/aditem/add/">创建广告条目</a></p>
					{% if is_paginated %}
                    {% ifequal current_page 1 %}
                    {% else %} <a href="?page=1"><img src="../medias/images/first.png" border="0" width="16" height="16" alt="转到第一页" /></a>
                    {% endifequal %}
                    {% if has_previous %} <a href="?page={{ previous }}"><img src="../medias/images/previous.png" border="0" width="16" height="16" alt="上一页" /></a>
                    {% else %} <img src="../medias/images/previous.png" width="16" height="16" border="0" alt="上一页" />
                    {% endif %}
                    {% for p in page_numbers %}
                        <a href="?page={{ p }}">{{ p }}</a>
                    {% endfor %}
                    {% if has_next %}<a href="?page={{ next }}"><img src="../medias/images/next.png" border="0" width="16" height="16" alt="下一页" /></a>
                    {% else %}<img src="../medias/images/next.png" border="0" width="16" height="16" alt="下一页" />
                    {% endif %}
                    {% ifequal current_page pages %}<img src="../medias/images/last.png" border="0" width="16" height="16" alt="转到最后一页" />
                    {% else %} <a href="?page={{ pages }}"><img src="../medias/images/last.png" border="0" width="16" height="16" alt="转到最后一页" /></a>
                    {% endifequal %}
                    &nbsp;&nbsp;
                    当前页：{{ page }}/{{ pages }}
                    &nbsp;&nbsp;
					{% endif %}              
					共[&nbsp;{{ hits }}&nbsp;]个广告条目
		{% load ad_tags %}
		{% flash %}
		 <h2>{{ params.type }}</h2>
		{{ msg }}
		{% endflash %}
		<form method="put" action="" name="adorgform">
		<table cellspacing="0" border="0">
		<caption>广告条目列表</caption>
	<tr>
		<td> 广告名称 </td>
		<td> 广告类型 </td>
		<td> 是否可用 </td>
		<td> 开始日期 </td>
		<td> 结束日期 </td>
		<td> 播放时长 </td>
		<td> 创建者 </td>
		<td> 创建日期 </td>
		<td> 最后修改者 </td>
		<td> 最后修改时间 </td>
		<td> &nbsp;</td>
	</tr>
	{% for x in object_list %}
	<tr class="{% cycle alt,'' %}">
		<td> <a href="/aditem/{{x.id}}/">{{ x.ad_item_name }}</a></td>
		<td> {{ x.get_ad_item_protocol_display}}</td>
		<td> {% if x.ad_item_useable %}
			<a href="/aditem/{{ x.id }}/chgstate/"><img src="/medias/images/ok.png" border="0" width="16" height="16" alt="" /></a>
			 {% else %}
			 <a href="/aditem/{{ x.id }}/chgstate/"><img src="/medias/images/lock.png" border="0" width="16" height="16" alt="" /></a>
			 {% endif %}
		</td>
		<td> {{ x.ad_item_start_date|date:"Y年 m月d日" }} </td>
		<td> {{ x.ad_item_expire_date|date:"Y年 m月d日" }} </td>
		<td> {{ x.ad_item_expire_date|timesince:x.ad_item_start_date}}</td>
		<td> {{ x.creator }} </td>
		<td> {{ x.ad_item_create_datetime|date:"Y年 m月d日 H:i:s" }} </td>
		<td> {{ x.last_modify_by }} </td>
		<td> {{ x.last_modify_datetime|date:"Y年 m月d日 H:i:s" }} </td>
		<td> 
		<a href="#"><img src="/medias/images/del.png" width="16" height="16" border="0" alt="删除广告条目" onclick="javascript:if (window.confirm('确认删除?\n\n被删除后有可能造成不可恢复的错误')){location.href='/aditem/{{ x.id }}/del/'}"></a>&nbsp;
		</td>
	</tr>
	{% endfor %}
</table>
		</form>

					{% if is_paginated %}
                    {% ifequal current_page 1 %}
                    {% else %} <a href="?page=1"><img src="../medias/images/first.png" border="0" width="16" height="16" alt="转到第一页" /></a>
                    {% endifequal %}
                    {% if has_previous %} <a href="?page={{ previous }}"><img src="../medias/images/previous.png" border="0" width="16" height="16" alt="上一页" /></a>
                    {% else %} <img src="../medias/images/previous.png" width="16" height="16" border="0" alt="上一页" />
                    {% endif %}
                    {% for p in page_numbers %}
                        <a href="?page={{ p }}">{{ p }}</a>
                    {% endfor %}
                    {% if has_next %}<a href="?page={{ next }}"><img src="../medias/images/next.png" border="0" width="16" height="16" alt="下一页" /></a>
                    {% else %}<img src="../medias/images/next.png" border="0" width="16" height="16" alt="下一页" />
                    {% endif %}
                    {% ifequal current_page pages %}<img src="../medias/images/last.png" border="0" width="16" height="16" alt="转到最后一页" />
                    {% else %} <a href="?page={{ pages }}"><img src="../medias/images/last.png" border="0" width="16" height="16" alt="转到最后一页" /></a>
                    {% endifequal %}
                    &nbsp;&nbsp;
                    当前页：{{ page }}/{{ pages }}
                    &nbsp;&nbsp;
					{% endif %}              
					共[&nbsp;{{ hits }}&nbsp;]个广告条目
		</div>
	</div>

</div>
{% include "footer.html" %}
